Prevent chunk extension request smuggling#2134
Open
erikdubbelboer wants to merge 14 commits intomasterfrom
Open
Prevent chunk extension request smuggling#2134erikdubbelboer wants to merge 14 commits intomasterfrom
erikdubbelboer wants to merge 14 commits intomasterfrom
Conversation
1ef3788 to
0db2f6a
Compare
There was a problem hiding this comment.
Pull request overview
Improves HTTP request/response parsing and fuzzing to better match Go’s net/http behavior and harden against chunk-extension based request smuggling.
Changes:
- Tightens chunk-size parsing to properly validate separators and safely skip chunk extensions.
- Enforces HTTP/1.1 Host requirement during request parsing and treats missing trailer terminators as broken chunks.
- Updates unit tests and fuzzers to include mandatory Host / valid status lines and to compare against
net/http.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
http.go |
Enforces Host for HTTP/1.1 requests, maps EOF-in-trailer to broken chunk, and hardens chunk-size parsing. |
header.go |
Tightens response/request first-line parsing (HTTP version and status code validation). |
http_test.go |
Adjusts request/response parsing tests for stricter parsing (valid status line, Host header) and multipart chunked formatting. |
header_test.go |
Updates response header tests (discard body between sequential responses; removes now-invalid “foobar” protocol test). |
fuzz_test.go |
Expands fuzzing to compare fasthttp body parsing against net/http under size limits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0db2f6a to
d1eba1d
Compare
Improve fuzzers to make sure our handling of http requests and responses is the same as net/http.
887ef70 to
09d0cdb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve fuzzers to make sure our handling of http requests and responses is the same as net/http.
Thanks to https://github.com/xclow3n for reporting this!